<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<jsp:useBean id="othhome_message1" scope="session" class="software.Use_user"/>
<jsp:useBean id="othhome_message2" scope="session" class="software.Fri_done"/>
<jsp:useBean id="othhome_message3" scope="session" class="software.Mes_function"/>
 <%@ page import="softdone.Paination" %>
 <%@ page language="java" import="softdata.Mes_data"%>
 <html>
 <head>
 <title>My JSP 'selhome.jsp' starting page</title>
 </head>
  <body>
  <script Language="javascript">
	function openstr1(relId)
	{   
		window.showModalDialog("othmessage_reply_read.jsp?RelId="+relId,window,"dialogWidth=289px;dialogHeight=154px;status=no");
	}
	</script>
  <% 
   String IDseloth1=session.getAttribute("ID").toString();
    int  IDseloth=Integer.parseInt(IDseloth1);
  Paination pa=(Paination)session.getAttribute("othhome_message4"); %>
  <form action="othhome_message2.jsp" method="post" name="page" onsubmit="return checkPage(page)">
      <a href="othhome_main.jsp?mk=1"">返回他的主页</a>
       共有<font color="red" size="1"><%=pa.getTotalRows() %></font>条留言
       <%if(pa.isHasPreviousPage())
       		out.print("<a href='othhome_message2.jsp?requestPage=previousPage'>上一页</a>");%>
       		<%if(pa.isHasNextPage())
       		out.print("<a href='othhome_message2.jsp?requestPage=nextPage'>下一页</a>");%>
     	第<input type="text" name="jump" size="3" maxlength="2">页
       	<input type="submit" value="转到>>">
       </td>
    </tr>
 </form>
 <table width="1160" border="1" height="50">
   <%     
        List notes=new ArrayList();
         String requestPage=request.getParameter("requestPage");
     	 if(request.getParameter("jump")!=null){
            String jumpPage1 =request.getParameter("jump");
            int jumpPage = Integer.parseInt(jumpPage1);
            notes=pa.AppointPageList(jumpPage);        
      	 }  
         else{
          if(requestPage.equals("previousPage")){
           notes =pa.getPreviousPageList();
        	}else if(requestPage.equals("nextPage")){
            notes=pa.getNextPageList();
            }  
            }%>
            <tr align = 'center'>
      	<td width="259">留言内容</td>
     	 <td width="88">好友</td>
     	 <td width="88">留言时间</td>
    	</tr>
            <%
           for(int m=0;m<notes.size();m++){   
			out.println("<tr>");
            Mes_data note=(Mes_data)notes.get(m);
            othhome_message3.setmessage(note);
            String name =othhome_message1.getName(othhome_message3.getId_Use_Post());
             out.println("<td  align = center width='739'>"+othhome_message3.getCon_Message()+"</td>");
            %>
            <td align = center  width=88><%=name%></td>
            <%out.print("<td width=88>"+othhome_message3.getTim_Message()+"</td>");
            int mark=othhome_message3.Mes_function_check__rel(othhome_message3.getID());
            if(mark!=0)
            {
           %>
            <td align = center width=80><a href="#" onclick="return openstr1(<%=othhome_message3.getID()%>)">我的回复</a></td>
            <%
            }
            else
            {
           %>
            <td width=80>未回复</td>
            <%
            }
            out.print("<br>");
            out.print("</tr>");
			}
   %>
   </table>
      当前是第<font color="red" size="1"><%=pa.getCurrentPage()+"/"+pa.getTotalPages() %></font>页
     <a href="javascript:location.reload()">刷新</a>
  </body>
</html>
